package com.zhb86.live.plain;

import com.qiniu.pili.droid.streaming.AVCodecType;
import com.qiniu.pili.droid.streaming.StreamingProfile;
import com.qiniu.pili.droid.streaming.WatermarkSetting;

import java.io.Serializable;

import static com.qiniu.pili.droid.streaming.StreamingProfile.AUDIO_QUALITY_MEDIUM2;
import static com.qiniu.pili.droid.streaming.StreamingProfile.VIDEO_QUALITY_MEDIUM3;
import static com.qiniu.pili.droid.streaming.StreamingProfile.YuvFilterMode.None;
import static com.qiniu.pili.droid.streaming.WatermarkSetting.WATERMARK_SIZE.MEDIUM;

public class EncodingConfig implements Serializable {
    public AVCodecType mCodecType = AVCodecType.HW_VIDEO_SURFACE_AS_INPUT_WITH_HW_AUDIO_CODEC;
    public boolean mIsAudioOnly = false;

    public boolean mIsVideoQualityPreset = true;
    public int mVideoQualityPreset = VIDEO_QUALITY_MEDIUM3;
    public int mVideoQualityCustomFPS = 30;
    public int mVideoQualityCustomBitrate = 1000;
    public int mVideoQualityCustomMaxKeyFrameInterval = 60;
    public StreamingProfile.H264Profile mVideoQualityCustomProfile = null;//StreamingProfile.H264Profile.MAIN;

    public boolean mIsVideoSizePreset = true;
    public int mVideoSizePreset = 3;

    public int mVideoSizeCustomWidth = 720;
    public int mVideoSizeCustomHeight = 1280;

    public boolean mVideoOrientationPortrait = true;

    public boolean mVideoRateControlQuality = true;
    /**根据网络状态自适应码率*/
    public StreamingProfile.BitrateAdjustMode mBitrateAdjustMode = StreamingProfile.BitrateAdjustMode.Auto;
    public int mAdaptiveBitrateMin = 150;
    public int mAdaptiveBitrateMax = 2000;

    public boolean mVideoFPSControl = true;

    public boolean mIsWatermarkEnabled;
    public int mWatermarkAlpha = 100;
    public WatermarkSetting.WATERMARK_SIZE mWatermarkSize = MEDIUM;
    public int mWatermarkCustomWidth = 100;
    public int mWatermarkCustomHeight = 100;
    public boolean mIsWatermarkLocationPreset = true;
    public WatermarkSetting.WATERMARK_LOCATION mWatermarkLocationPreset = WatermarkSetting.WATERMARK_LOCATION.NORTH_WEST;
    public float mWatermarkLocationCustomX = 0;
    public float mWatermarkLocationCustomY = 0;

    public boolean mIsPictureStreamingEnabled;
    public String mPictureStreamingFilePath;

    public boolean mIsAudioQualityPreset = true;
    public int mAudioQualityPreset = AUDIO_QUALITY_MEDIUM2;
    /**注：44100 是 Android 平台唯一保证所有设备支持的采样率，为了避免音频兼容性问题，建议设置为 44100*/
    public int mAudioQualityCustomSampleRate = 44100;
    public int mAudioQualityCustomBitrate = 96;

    public StreamingProfile.YuvFilterMode mYuvFilterMode = None  ;
}
